import type { BuildingListData, BuildingListParams, BuildingParams } from "@/types/building";
import { request } from "@/utils/reuqest";


/**
 * 获取楼宇列表
 * @param {*}
 * @returns
 */
export const getBuildingListAPI = (params: BuildingListParams) => {
  return request<BuildingListData>('/park/building', 'GET', params)
}

/**
 * 创建楼宇
 * @param {}
 * @returns
 */
export const createBuildingAPI = (data: BuildingParams) => {
  return request('/park/building', 'POST', data)
}

/**
 * 更新楼宇
 * @param {}
 * @returns
 */
export const updateBuildingAPI = (data: BuildingParams) => {
  return request('/park/building', 'PUT', data)
}


/**
 * 删除楼宇
 * @param {}
 * @returns
 */
export const delBuildingAPI = (id: number) => {
  return request(`/park/building/${id}`, 'DELETE')
}